package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity4 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);

        Button buttonP = findViewById(R.id.buttonP);
        buttonP.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EditText editText = findViewById(R.id.editTextTextjjj);
                String ingput = editText.getText().toString().trim();
                EditText editText1 = findViewById(R.id.editTrPassword);
                String ingput1 = editText1.getText().toString().trim();
                if (ingput.matches("^[a-zA-Z0-9]{1,10}") && ingput1.matches("^[0-9]{1,10}")) {
                    //String TITLE = ingput.getBytes(ingput).toString();
                    Intent intent = new Intent();
//                    Intent intent = new Intent(MainActivity4.this, MainActivity.class);
                    intent.putExtra("ingput", ingput);
                    intent.putExtra("ingput1", ingput1);
//                    startActivity(intent);
                    setResult(101,intent);
                    finish();

                }

            }
        });
    }
}